


$(function () {
    layui.use('upload', function(){
        var upload = layui.upload;
        var uploadInst = upload.render({
            elem: '#test1' //绑定元素
            ,url: '/img/upload' //上传接口
            ,done: function(res){
                //上传完毕回调
                layer.msg(res.msg);
                location.reload();
            }
            ,error: function(){
                //请求异常回调
                layer.msg("请求异常");
            }
        });
    });

    $("#update_btn2").click(function () {
        var params = $("#update_form2").serialize();

        $.ajax({
            type:"post"
            ,url:'/config/update2'
            ,data:params
            ,success:function (r) {
                if(r=='success'){
                    layer.msg("修改成功");
                }else{
                    layer.msg(r);
                }
            }
        })
    })



    $("#update_btn3").click(function () {
        var params = $("#update_form3").serialize();

        $.ajax({
            type:"post"
            ,url:'/config/update3'
            ,data:params
            ,success:function (r) {
                if(r=='success'){
                    layer.msg("修改成功");
                }else{
                    layer.msg(r);
                }
            }
        })
    })




})







